
-- LUA script for example game
-- player script


function Added(entity)

	-- store information important for this entity.
	
	scriptobject = {}
    scriptobject.position = GetPositionComponent(entity)
    entitytable[entity] = scriptobject
end


function Process(entity)
	this = entitytable[entity]
    this.position:AddX(1)
    
    if this.position:GetX() > 100 then
        this.position:Reset(-100, this.position:GetY())
    end
    
end


function Removed(entity)
	entitytable[entity] = nil
end

